<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous">
	<link rel="stylesheet" th:href="@{/css/global.css}" />
	<title>个人帖子</title>
</head>
<body>
	<div class="nk-container">
		<!-- 头部 -->
		<header class="bg-dark sticky-top" th:replace="/site/home::header">

		</header>

		<!-- 内容 -->
		<div class="main">
			<div class="container">
				<!-- 选项 -->
				<!-- 我的帖子 -->
				<div class="mt-4">
					<ul class="list-unstyled mt-4 pl-3 pr-3" th:each="map:${userPosts}">
						<li class="border-bottom pb-3 mt-4">
							<div class="post" style="width: 880px;">
								<div class="user-block">
									<a th:href="@{|/user/profile/${map.user.id}|}">
										<img class="img-circle img-bordered-sm" th:src="${map.user.headerUrl}" style="width:50px;height:50px;" alt="user image">
									</a>
									<a th:href="@{|/discuss/detail/${map.post.id}|}" th:utext="${map.post.title}" style="color: blue;font-size: 25px">标题</a>
									&nbsp &nbsp &nbsp
									<span class="btn-lg btn-danger" th:if="${map.post.type==1}">置顶</span>
									&nbsp &nbsp &nbsp
									<button class="btn-lg btn-success" id="rebackBtn" th:onclick="|reback(${map.post.id})|">恢复</button>


								</div>
								<!-- /.user-block -->
								<p  th:utext="| &nbsp &nbsp   ${map.post.content}|" style="font-style: inherit;font-size: 20px">
									内容
								</p>
								<p>
									<a href="#">
										<i class="far fa-comments"></i>
										<ul class="d-inline">
											<li class="d-inline ml-2 float-left"><a href="#" class="link-black text-sm mr-2"><i class="fas fa-share mr-1">
									<span class="description">
									<a th:href="@{|/user/profile/${map.user.id}|}"><b th:utext="${map.user.username}" style="color: #0c525d"></b></a>
									<b style="font-size: 15px;color: grey"> &nbsp &nbsp 发布于</b>
									---
									<b th:text="${#dates.format(map.post.createTime,'yyyy-MM-dd HH:mm:ss')}" style="font-size: 15px;color: grey">2019-04-15 15:32:18</b>
								</span>
											</i> </a> </li>

										</ul>
									</a>
								</p>

							</div>
						</li>

					</ul>
					<!-- 分页 -->
					<nav class="mt-5" th:replace="/site/home::pagination">

					</nav>					
				</div>				
			</div>
		</div>

		<!-- 尾部 -->
		<footer class="bg-dark" th:replace="/site/home::footer">

		</footer>
	</div>

	<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" crossorigin="anonymous"></script>
	<script th:src="@{/js/global.js}"></script>
	<script>
		function reback(postId){
			$.get(
					CONTEXT_PATH + "/reback",
					{"postId":postId},
					function () {
						location.href = CONTEXT_PATH + "/home";
					}
			)
		}

	</script>
</body>
</html>
